from mypro.settings import SECRET_KEY
import jwt

class MJwt():
    def __init__(self):
        self.secret = SECRET_KEY

    #加密
    def jwt_encode(self,data):
        return jwt.encode(data,self.secret,algorithm="HS256")

    #解密
    def jwt_decode(self,token):
        return jwt.decode(token,self.secret,algorithms="HS256")


mjwt = MJwt()